import request from '@/utils/request'

export const getRoomList = () => {
  return request.get('/user/rooms/types/all')
}

// 获取房间类型详情
export const getRoomTypeDetail = (roomTypeId) => {
// =======
// export const getRoomDetail = (roomTypeId) => {
  return request.get(`/user/rooms/${roomTypeId}`)
}

// export const getRoomDetail = (roomTypeId) => {
//   return request.get(`/user/rooms/${roomTypeId}`)
// }

export const getLeisureRoom = (roomTypeId) => {
  return request.get(`/user/rooms/getRoomsInType/${roomTypeId}`)
}

// 根据房间号查询房间详情
export const getRoomIdDetail = (roomId) => {
  return request.get(`/user/rooms?roomId=${roomId}`)
}

export const getAllRoom = () => {
  return request.get('/admin/rooms/all/list')
}

export const updateRoomStatus = (roomNumber, statusNumber) => {
  return request.put(`/admin/rooms/status/update/${roomNumber}/${statusNumber}`)
}

export const getAllRoomTypeList = () => {
  return request.get('/admin/roomTypes/list')
}

export const deleteRoomType = (roomTypeId) => {
  return request.delete(`/admin/roomTypes/${roomTypeId}`)
}

export const createRoomType = (roomTypesDTO) => {
  return request.post('/admin/roomTypes/add', roomTypesDTO)
}

export const updateRoomType = (roomTypes) => {
  return request.put('/admin/roomTypes/update', roomTypes)
}
